<?php $this->import('Header') ?>
<?php $this->import('Dog/TopInfo') ?>
<div class="container">
    <div class="well well-sm dog-info">
        <p class="bg-title title">
            <span>
                Ta的帖子
                <?php if ($categoryInfo) { ?>
                (<?php echo $categoryInfo['CategoryName'] ?>)
                <?php } ?>
            </span>
            <a class="right" href="/dog/single_u<?php echo $userInfo['UserId'] ?>.html"><i class="glyphicon glyphicon-th-list"></i> 全部帖子</a>
        </p>
        <div class="row">
            <div class="col-xs-10 article-list">
                <?php if ($articles) { ?>
                    <?php foreach ($articles as $article) { ?>
                        <div class="article-item row">
                            <div class="col-xs-8 tit">
                                <a href="/single/detail_<?php echo $article['ArticleId'] ?>.html"><?php echo $article['Title'] ?></a>
                                <?php if ($article['ImgList']) { $imgList = explode(',', trim($article['ImgList']));$imgList = array_slice($imgList, 0, 4);{ ?>
                                    <div class="list-img">
                                        <?php foreach ($imgList as $img) { ?>
                                            <a href="/single/detail_<?php echo $article['ArticleId'] ?>.html" class="img-rounded"><img data-src="<?php echo $img ?>"></a>
                                        <?php } ?>
                                    </div>
                                <?php } } ?>
                            </div>
                            <div class="col-xs-4 do">
                                <span><?php echo date('Y-m-d H:i:s', $article['CreateTime']) ?></span>&nbsp;&nbsp;
                                <a href="/single/detail_<?php echo $article['ArticleId'] ?>.html">查看</a>
                            </div>
                        </div>
                    <?php } ?>
                    <?php \Controller\UC\Pager::instance()->run(array('pager' => $pager)) ?>
                <?php } else { ?>
                    <h4 class="none">他一篇也没找到哦！</h4>
                <?php } ?>
            </div>
            <div class="col-xs-2 list-category">
                <div class="tit">分类（<?php echo $count ?>）</div>
                <div class="list">
                    <?php foreach($categoryInfoAndNumbers as $val) { ?>
                        <a class="c1" href="javascript:;"><?php echo $val['CategoryName'] ?></a>
                        <div class="item">
                            <?php foreach($val['List'] as $v) { ?>
                                <a class="c2" href="?c=<?php echo $v['CategoryId'] ?>"><?php echo $v['CategoryName'] ?>（<?php echo $v['Number'] ?>）</a>
                            <?php } ?>
                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->import('Footer') ?>
<script>
    seajs.init({
        userId: <?php echo $userInfo['UserId'] ?>
    });
</script>